package com.zxkj.domain.mapper;

import com.zxkj.domain.entity.PublicationImpactfactor;
import com.zxkj.domain.entity.PublicationSubjectarea;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by Administrator on 2017/9/30.
 */
@Service
public class PublicationServiceImpl implements PublicationService {

    @Autowired
    @Qualifier("primaryJdbcTemplate")
    protected JdbcTemplate jdbcTemplate;

    public List<PublicationImpactfactor> getPublicationImpactfactor() {
        StringBuilder sb = new StringBuilder();
        sb.append("select * from publication_impactfactor ORDER BY ISSN,`Year`");
        return jdbcTemplate.query(sb.toString(), new BeanPropertyRowMapper(PublicationImpactfactor.class));
    }

    public List<PublicationSubjectarea> getPublicationSubjectarea() {
        StringBuilder sb = new StringBuilder();
        sb.append("select * from publication_subjectarea ");
        return jdbcTemplate.query(sb.toString(), new BeanPropertyRowMapper(PublicationSubjectarea.class));
    }
}
